<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="IP段地址管理" name="0"> </el-tab-pane>
      <el-tab-pane label="IP地址管理" name="1"> </el-tab-pane>
      <el-tab-pane label="IP地址使用监控" name="2"> </el-tab-pane>
    </el-tabs>
    <component :is="activeTemplate" />
  </div>
</template>

<script>
import IPSegmentManagement from "./ipSegmentAddressManagement/index.vue"; // IP段地址管理
import IPAddressManagement from "./ipAddressManagement/index.vue"; // IP地址管理
import AddressMonitor from "./addressMonitor/index.vue"; // IP地址使用监控
export default {
  data() {
    return {
      activeName: "0",
      activeTemplate: "IPSegmentManagement",
    };
  },
  components: {
    IPSegmentManagement,
    IPAddressManagement,
    AddressMonitor,
  },
  watch: {
    // // 监视路由变化
    // "$route.query.activeName": {
    //   immediate: true,
    //   handler() {
    //     this.activeName = this.$route.query.activeName?this.$route.query.activeName:'first';
    //   },
    // },
  },
  methods: {
    handleClick() {
      switch (this.activeName) {
        case "0":
          this.activeTemplate = "IPSegmentManagement";
          break;
        case "1":
          this.activeTemplate = "IPAddressManagement";
          break;
        case "2":
          this.activeTemplate = "AddressMonitor";
          break;
      }
    },
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
.internal-approval {}
</style>